package com.aca.entity;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;

@ToString
@NoArgsConstructor
@AllArgsConstructor
@Entity
public class Scene implements Serializable {
    //场景编号
    private int sno;
    //场景名
    private String sname;
    //场景描述
    private String sdesc;

    @Id
    @Column(name = "sno")
    public int getSno() {
        return sno;
    }

    public void setSno(int sno) {
        this.sno = sno;
    }

    @Basic
    @Column(name = "sname")
    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    @Basic
    @Column(name = "sdesc")
    public String getSdesc() {
        return sdesc;
    }

    public void setSdesc(String sdesc) {
        this.sdesc = sdesc;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Scene scene = (Scene) o;

        if (sno != scene.sno) return false;
        if (sname != null ? !sname.equals(scene.sname) : scene.sname != null) return false;
        if (sdesc != null ? !sdesc.equals(scene.sdesc) : scene.sdesc != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = sno;
        result = 31 * result + (sname != null ? sname.hashCode() : 0);
        result = 31 * result + (sdesc != null ? sdesc.hashCode() : 0);
        return result;
    }
}
